<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Computer parts and purposes',
	'<{subtitle}>' => 'Written in <span title="Software Engineering 1">CS 2401</span>, finalised on 2017-12-20',
	'<{copyright year}>' => '2017',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<p>
	In this paper, we take a look at four of the main components of the $a[CPU], as well as control codes, the signals used to instruct components of the $a[CPU] how to function.
</p>
<h2>Arithmetic logic unit</h2>
<p>
	The arithmetic logic unit, often abbreviated as the &quot;ALU&quot;, is a component in the $a[CPU] used for performing basic, low-level calculations (Nisan &amp; Schocken, n.d.).
	As we saw last unit in the arithmetic logic units that we built ourselves, some of the operations they can perform include addition, subtraction, and bitwise operations such as AND and OR.
	These were only basic arithmetic logic units though, and real ones are often more complex and capable of more operations.
	This logic unit is a part of the processor, and is able to access the processor&apos;s control unit (Rouse, 2005).
	It takes as input an instruction and one or more operands.
	Often times, the arithmetic logic unit will also include registers for input and output, like our own arithmetic logic units we added registers to last week.
</p>
<h2>Instruction decoder</h2>
<p>
	The instruction decode takes an instruction, breaks it into its component parts, and sends those parts to the appropriate places (Wikibooks, 2016).
	The implication of this is that the instruction decoder has access to all parts of the computer that might need to perform an operation, including the arithmetic logic unit, the program counter, and the control unit.
	In a well-designed processor, the instruction decoder is able to simply send certain bits of the instruction to the logic unit that needs to handle the rest of the instruction, at least for some instructions.
	For other instructions, the instruction decoder is required to produce the bits that will be read by the logic units.
</p>
<h2>Clock and program counter</h2>
<p>
	The program counter is a register that always stores the address of the next instruction that needs to be loaded (Nisan &amp; Schocken, n.d.).
	That way, the $a[CPU] always knows where to look to find out what to do next.
	This register is updated during instruction execution in preparation for retrieving the following instruction.
	During normal execution, the value in this register will simply be incremented.
	However, when dealing with instructions that say to jump to another part of the program, the location of the jump&apos;s landing point will be stored instead.
</p>
<p>
	The clock oscillates between two states, high (<code>1</code>) and low (<code>0</code>), at a regular rate (Nisan &amp; Schocken, n.d.).
	It&apos;s what gives latches, and by extension, data flip-flops, their sense of time.
	It keeps the computer synchronised and its intervals give logic circuits time to work without their not-yet-complete results poisoning the input to the next component.
	For example, it tells the registers on the arithmetic logic unit when to react, capturing the output when it should be ready.
	The clock signal can also be fed into a counter to form a basis for the program counter.
	To fulfil its function, the clock has access to all sequential components of the machine, such as the instruction decoder, control unit, and many if not all of the registers.
</p>
<h2>Control codes</h2>
<p>
	Control codes are used to instruct components such as the arithmetic logic unit as to what task to perform (Schmalz, n.d.).
	They are emitted by the control unit based on how the instruction decoder interprets an instruction.
	Regular machine language in interpreted by the instruction decoder, but control codes are basically an even-lower levelled machine language that is specific not to the $a[CPU] as a whole, but to the subcomponent that the control codes are sent to.
	For example, the arithmetic logic unit doesn&apos;t need to understand the entire range of functionality of the entire machine; instead, control codes are used to instruct the arithmetic logic unit as to what to do in simpler terms and with fewer bits.
</p>
<h2>Control unit</h2>
<p>
	The control unit is the component of the $a[CPU] responsible for decoding instructions by use of the instruction decoder and signalling the various other parts of the $a[CPU] and non-$a[CPU] components, instructing them how to behave (Nisan &amp; Schocken, n.d.).
	Is does this through the use of control codes.
</p>
<h2>Conclusion</h2>
<p>
	These four components are by no means the only components a $a[CPU] has.
	However, they&apos;re some of the more important ones to understand if trying to learn how the $a[CPU] works as a whole.
</p>
<h2>Plagiarisma report</h2>
<p>
	The assignment instructions ask us to submit our work to Plagiarisma and include the provided report in our essay.
	Plagiarisma had this to say:
</p>
<blockquote cite="http://plagiarisma.net/">
	<p>100% Unique</p>
	<p>Total 5434 chars (2000 limit exceeded) , 337 words, 13 unique sentence(s).</p>
</blockquote>
<div class="APA_references">
	<h2>References:</h2>
	<p>
		Nisan, &amp; Schocken. (n.d.). Computer Architecture. Retrieved from <a href="https://my.uopeople.edu/pluginfile.php/232176/mod_resource/content/1/chapter%2005.pdf"><code>https://my.uopeople.edu/pluginfile.php/232176/mod_resource/content/1/chapter%2005.pdf</code></a>
	</p>
	<p>
		Nisan, &amp; Schocken. (n.d.). Sequential Logic. Retrieved from <a href="https://my.uopeople.edu/mod/resource/view.php?id=132831"><code>https://my.uopeople.edu/mod/resource/view.php?id=132831</code></a>
	</p>
	<p>
		Rouse, M. (2005, September). What is arithmetic-logic unit (ALU)? - Definition from WhatIs.com. Retrieved from <a href="http://whatis.techtarget.com/definition/arithmetic-logic-unit-ALU"><code>http://whatis.techtarget.com/definition/arithmetic-logic-unit-ALU</code></a>
	</p>
	<p>
		Schmalz, M. S. (n.d.). Organization of Computer Systems: Processor &amp; Datapath. Retrieved from <a href="https://www.cise.ufl.edu/~mssz/CompOrg/CDA-proc.html"><code>https://www.cise.ufl.edu/~mssz/CompOrg/CDA-proc.html</code></a>
	</p>
	<p>
		Wikibooks. (2016, December 28). Microprocessor Design/Instruction Decoder - Wikibooks, open books for an open world. Retrieved December 20, 2017, from <a href="https://en.wikibooks.org/wiki/Microprocessor_Design/Instruction_Decoder"><code>https://en.wikibooks.org/wiki/Microprocessor_Design/Instruction_Decoder</code></a>
	</p>
</div>
END
);
